def mask(card: str) -> str:
    if '-' in card:
        return '****-****-****-' + card[-4:]
    elif ' ' in card:
        return '**** **** **** ' + card[-4:]